*******************************************************************************************
*******************************************************************************************
******************** Reclassification Risk in the Small Group Health Insurance Market
******************* by Sebastian Fleitas, Gautam Gowrisankaran and Anthony Lo Sasso 
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************
******************** Table C3
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************


cd "~/Dropbox/ReclassificationRisk/"
*cd "/Volumes/PUC_Dropbox_Seba/Dropbox/ReclassificationRisk"

use database_individual_level.dta, replace 
do Restat_Table6_USICcorrection_splines.do 


**************************************************************************************************
**************************************************************************************************

**************************************************************************************************
**************************************************************************************************
********    MAIN ESTIMATES 
**************************************************************************************************
**************************************************************************************************

*********************************************************************************
**** TABLE 
******************************************************************************************************************

** Get main estimate  
reghdfe mean_premium mean_pred_riskscore_rp  yeardum* , absorb(mbr_sys_id) vce(cluster customer_number year)
gen sample = e(sample)
reghdfe mean_premium mean_pred_riskscore_rp prob_leaving* yeardum* , absorb(mbr_sys_id) vce(cluster customer_number year)

exit 

** Now controlling by conditions 
reghdfe mean_premium mean_pred_riskscore_rp prob_leaving*  lagged_chronic_cancer             yeardum* , absorb(mbr_sys_id) cluster(customer_number year)
reghdfe mean_premium mean_pred_riskscore_rp prob_leaving*  lagged_chronic_transplant         yeardum* , absorb(mbr_sys_id) cluster(customer_number year)
reghdfe mean_premium mean_pred_riskscore_rp prob_leaving*  lagged_chronic_ami                yeardum* , absorb(mbr_sys_id) cluster(customer_number year)
reghdfe mean_premium mean_pred_riskscore_rp prob_leaving*  lagged_chronic_diabetes           yeardum* , absorb(mbr_sys_id) cluster(customer_number year)



reghdfe mean_premium mean_pred_riskscore_rp prob_leaving*  lagged_code_hypertension          yeardum* , absorb(mbr_sys_id) cluster(customer_number year)
reghdfe mean_premium mean_pred_riskscore_rp prob_leaving*  lagged_code_heartfailure          yeardum* , absorb(mbr_sys_id) cluster(customer_number year)
reghdfe mean_premium mean_pred_riskscore_rp prob_leaving*  lagged_code_chronickidneydisease  yeardum* , absorb(mbr_sys_id) cluster(customer_number year)
reghdfe mean_premium mean_pred_riskscore_rp prob_leaving*  lagged_code_asthma                yeardum* , absorb(mbr_sys_id) cluster(customer_number year)

exit



reghdfe mean_premium mean_pred_riskscore_rp prob_leaving*  lagged_chronic_cancer lagged_chronic_transplant lagged_chronic_ami lagged_chronic_diabetes lagged_code_hypertension lagged_code_heartfailure lagged_code_chronickidneydisease lagged_code_asthma numpeople yeardum* , absorb(mbr_sys_id) cluster(customer_number year)

reghdfe mean_premium mean_pred_riskscore_rp prob_leaving  lagged_chronic_cancer lagged_chronic_transplant lagged_chronic_ami lagged_chronic_diabetes lagged_code_hypertension lagged_code_heartfailure lagged_code_chronickidneydisease lagged_code_asthma numpeople yeardum* , absorb(mbr_sys_id) cluster(customer_number year)

exit 

